home *** CD-ROM | disk | FTP | other *** search
/ Macworld Expo - Develope…Central & Net Innovations / Developer Central and Net Innovators (MacWorld Expo) (January 1999).iso / Developer Central / Metrowerks CodeWarrior / CodeWarrior Pro 4 Release Notes / PowerPlant Notes / Debugging Classes Release Notes < prev    next >
Encoding:
Text File  |  1998-08-21  |  24.8 KB  |  638 lines  |  [TEXT/CWIE]

  1. ========================================================================
  2. Metrowerks PowerPlant Debugging Classes Release Notes
  3. ========================================================================
  4. Version: 1.1, Part of PowerPlant 1.9.2, CW Pro 4
  5. Date:    21 August 1998
  6. Author:  John C. Daub
  7. ========================================================================
  8.  
  9. The PowerPlant Debugging Classes are a set of utilities to aid in
  10. the development of PowerPlant-based projects.
  11.  
  12. They provide means and mechanisms to validate, stress, gain and record
  13. information all towards the end of helping you to write more solid and
  14. less buggy code. They build upon existing PowerPlant mechanisms and
  15. extend them to include 3rd party support as well as original ideas.
  16.  
  17.  
  18. ========================================================================
  19. New Features in This Version
  20. ========================================================================
  21.  
  22. Added in v1.1b2 (28 July 1998)
  23.  
  24. * IMPORTANT NOTE: Due to a bug in the MSL (MW07208), you will need to
  25.   use at least MSL 2.4.6 to utilize this version of the debugging classes.
  26.   
  27.   See the "Known Problems" section of this note for more details.
  28.  
  29. * Updated all code to work with UDebugging changes (UDebugging is now
  30.   a namespace instead of a class, so various code needed updating).
  31.   
  32.   - UDebuggingPlus
  33.       Updated declarations of gDebugThrow and gDebugSignal
  34.   
  35.   - PP_Debug.h
  36.       Updated all macros to conform to new techniques utilized in
  37.       UDebugging.h for namespaces.
  38.   
  39.   - PP_DebugConstants.h
  40.       Obsoleted the following constants:
  41.           cmd_gDebugThrowLowLevel
  42.           cmd_gDebugThrowSource
  43.           cmd_gDebugSignalLowLevel
  44.           cmd_gDebugSignalSource
  45.       
  46.       Created cmd_gDebugThrowDebugger, cmd_gDebugSignalDebugger which
  47.       utilize the same CommandT as the "low level" versions.
  48.   
  49.   
  50.   - LDebugStream
  51.       Since there is no further distinction between low and source level
  52.       debuggers, the EFlushLocation has a new flushLocation_Debugger.
  53.       The old enums remain for compatibility, but are obsolete.
  54.       
  55.       Flush() updated to utilize new enums and locations.
  56.   
  57.   - LDebugMenuAttachment.cp
  58.       Updated to use the new debugAction_Debugger enum. The old
  59.       low-level and source debugger enums have been removed.
  60.       
  61.       Updated the menu items and handler functionality to reflect the new
  62.       UDebugging enums.
  63.   
  64.   - UOnyx
  65.       Updated AlertThrowAt to match UDebugging's version
  66.       
  67.       Updated macros to conform to PP namespace.
  68.  
  69.  
  70. * Updated demo to match UDebugging changes as well as support for
  71.   the PowerPlant namespace.
  72.         
  73.  
  74. Added in v1.1b1 (15 July 1998)
  75.  
  76. * Rewrote UProcess a bit.
  77.  
  78.   SProcessInfo is more than a simple struct now. It allocates and
  79.   hides the storage for the name and FSSpec and uses a ProcessInfoRec
  80.   for the rest. This avoids copying in UProcess::GetInfo().
  81.   
  82.   If you wish to access the information directly, the ProcessInfoRec
  83.   is declared public:
  84.   
  85.       SProcessInfo    myInfo;
  86.       UProcess::GetMyInfo(myInfo);
  87.       FSSpec fileSpec = myInfo.info.processAppSpec;
  88.  
  89.   Accessors for spec and name have been provided.
  90.   
  91.   
  92.   Additional cleanups were done to GetCurrentPSN(), GetMyPSN(), and
  93.   then how this would have affected the rest of UProcess.
  94.   
  95.  
  96. Added in v1.1a5 (20 May 1998)
  97.  
  98. * Renamed the "MoreFiles 1.4.8" folder to simply "MoreFiles". It's more
  99.   generic, eases pain up upgrades and setting paths. The MoreFiles'
  100.   Readme should always be included and should contain version info.
  101.  
  102. Added in v1.1a4 (7 May 1998)
  103.  
  104. *  Updated to version 1.0b19e10 of the Spotlight API
  105.  
  106. *  Added menu access to the DebugNew flags (see the DebugNew docs for
  107.    usage information).
  108.  
  109. Added in v1.1a3 (24 April 1998)
  110.  
  111. * None. Getting the bugs squashed.
  112.  
  113. Added in v1.1a2 (22 April 1998)
  114.  
  115. * None. Concentrating on bug fixes.
  116.  
  117. Added in v1.1a1 (21 April 1998)
  118.  
  119. *  None. Concentrating on fixing bugs (I mean, what good are buggy
  120.    debugging classes ;-)
  121.    
  122.  
  123. ========================================================================
  124. Bugs Fixed in This Version
  125. ========================================================================
  126.  
  127. Fixed in v1.1a5 (28 May 1998)
  128.  
  129. * Modified how UMemoryEater and LTreeWindow choose to create the window.
  130.   Previously they tried to build from 'PPob', but if the resource wasn't
  131.   around, then they built on the fly. This is still the procedure, but
  132.   instead of throwing an exception if the resource isn't present (and
  133.   then some annoying breaks into the debugger if "Break on C++ Exception"
  134.   is enabled) now we check for the resource by a simple "if != nil"
  135.   check. If it's nil, build on the fly. Simple, a bit cleaner, and
  136.   certainly less annoying :-)
  137.  
  138. Fixed in v1.1a4 (11 May 1998)
  139.  
  140. *  LDebugMenuAttachment::FindUniqueMenuID() could hit infinite recursion
  141.    if looking for a submenu of ID 1 (as inStartID) and there was a
  142.    'MENU' resource of ID 1.
  143.    
  144.    The checks to (en)force the submenu ID limits have been removed and
  145.    replaced by a simple sanity checking Assert_().
  146.    
  147.    This fixed bug MW07042.
  148.  
  149. Fixed in v1.1a3 (24 April 1998)
  150.  
  151. *  The tree classes (LCommanderTree, LPaneTree) were plagued by problems
  152.    of nasty flicker and scrolling/drawing problems. I cleaned this up
  153.    by using a text engine instead of just blitting to screen. Now I
  154.    put all the text into a Handle, construct a StScrpHandle to make it
  155.    look pretty, and life is good.
  156.    
  157.    The implementation is a wee funky, but I wanted to ensure some sort
  158.    of backwards compatability, but also a way to expand (e.g. you could
  159.    use CWASTEEdit instead of LTextEditView if you wanted to with a
  160.    little subclassing and overriding).
  161.    
  162.    If you have an existing project, you will need to add LTextEditView.cp
  163.    and UTEViewTextAction.cp to your project.
  164.    
  165.    One "big" change was that I needed to move to a monospaced font for
  166.    the display. Since spaces are used to indent now, things just didn't
  167.    look good with a variable-width font, but of course you are welcome
  168.    to use that if you wish.
  169.    
  170.    All in all, everything will look pretty much the same to the end
  171.    user, just changed the innards, but it performs a lot better.
  172.    
  173.    Fixed bug MW06324.
  174.    
  175. Fixed in v1.1a2 (22 April 1998)
  176.  
  177. *  When QC changes state, if the state change was not performed through
  178.    the LDebugMenuAttachment menu (e.g. activate QC via its hotkey), the
  179.    menu was not updated to reflect the state change. This is a
  180.    combination of how PowerPlant defers menu updates until absolutely
  181.    needed and that QC doesn't "broadcast" state changes. Due to these
  182.    factors, LDebugMenuAttachment (only when PP_QC_SUPPORT is true) is
  183.    also an LPeriodical whose SpendTime will poll for the QC state and
  184.    keep the menus updated accordingly. Adds a slight bit of overhead,
  185.    but now state feedback is properly conveyed.
  186.  
  187. *  The SuppressThrow_()/ChangeThrow_() and SuppressSignal_()/
  188.    ChangeSignal_() macros declared the same variable names. This
  189.    prevented them from being used at the same time (the joys of copy
  190.    and paste!). Changed the Signal_() macros to use a more appropriate
  191.    and unique term (signal!)
  192.  
  193. *  UVolume
  194.  
  195.    The volume iteration mechanisms had problems with strange volumes,
  196.    like audio CD's. This was noticed when LDebugMenuAttachment did
  197.    its searches for ZoneRanger. This has been fixed as best as it
  198.    really can be, but after discussions with Apple DTS on the subject,
  199.    there are still obscure situations that could still cause problems.
  200.    
  201.    This addresses bug MW06289.
  202.  
  203. *  As a consequence of the above bug fix (MW06289), the searching
  204.    mechanisms in LDebugMenuAttachment for ZoneRanger have been
  205.    improved slightly. Now there are some additional checks if previous
  206.    checks fail, and instead of searching every time we launch, we
  207.    cache an AliasHandle to ZoneRanger.
  208.    
  209.    (As an interesting bit of information about the above 2 bugs, I've
  210.    included my coorespondance with Apple DTS on the subject at the end
  211.    of these release notes, just if you're curious.)
  212.    
  213.  
  214. Fixed in v1.1a1 (21 April 1998)
  215.  
  216. *  UProcess::GetCurrent() removed. It was an exact duplicate of the
  217.    UProcess::GetCurrentPSN() method (oops!). Just update your code to
  218.    call GetCurrentPSN instead.
  219.  
  220. *  UProcess::GetMyPSN()
  221.  
  222.    The original (v1.0, PP v1.9) implementation of this routine was
  223.    problematic and actually unnecessary (made things more complicated
  224.    than they had to be).
  225.    
  226.    I've been assured by Quinn "The Eskimo!" at Apple DTS that the
  227.    toolbox routine ::GetCurrentProcess(), if called at system task time,
  228.    will always return the PSN of the active process (if you're
  229.    calling this routine, you should be the active process, therefore
  230.    GetMyPSN() should always be logically correct).
  231.    
  232.    However, if you call ::GetCurrentProcess() at interrupt time, you
  233.    should be prepared to handle it returning kNoProcess (or an error)
  234.    to indicate as such. Therefore the methods in UProcess probably
  235.    aren't the most interrupt safe (as they can throw exceptions
  236.    anyways).
  237.    
  238.    Also, some UProcess methods required a 'BNDL' resource to be
  239.    present (this was due to the subsequent calling of GetMyPSN). This
  240.    is no longer a necessary requirement.
  241.    
  242.    This fixed bug MW06178.
  243.  
  244. *  UProcess::AmICurrent()
  245.  
  246.    Removed this routine as it was unnecessary after the above change
  247.    to GetMyPSN (it compared the results of GetCurrent() with GetMyPSN()
  248.    so you can see why this is no longer necessary).
  249.    
  250.    If you can call the routine, 99.99% you are the current process.
  251.  
  252. *  UProcess::GetPreviousPSN()
  253.  
  254.    Call AddItem instead of InsertItemsAt as it's faster and the same
  255.    behavior in the end.
  256.  
  257. *  Tried to restructure and guard uses of third party supports (QC,
  258.    Spotlight, DebugNew, etc.) a lot better so you didn't necessarily
  259.    have to use them or have their files pulled in unnecessarily.
  260.    
  261.    This fixed bugs MW06223, MW06324.
  262.  
  263. *  Cleaned up the demo application's "Validate PPob" dialog to be a
  264.    little more descriptive about just what the dialog is asking for.
  265.    
  266.    This fixed bug MW06678.
  267.  
  268. *  Trees.
  269.  
  270.    If a modal window is frontmost, one can no longer open the commander
  271.    and/or pane tree windows. Previously if there was a modal dialog,
  272.    the menu would be enabled, yet the window would appear and then
  273.    disappear immediately. This is because the command to show/hide
  274.    the window is the same (it's a toggle). And since the debug menu is
  275.    an attachment, when the command was generated from the menu, the
  276.    command is handled by ExecuteAttachments and then again by the
  277.    subsequent ObeyCommand! So to prevent this, the menu item is
  278.    disabled. You can still however manipulate the tree refresh time
  279.    from within a modal dialog.
  280.    
  281.    This fixed bug MW06678.
  282.    
  283.  
  284. ========================================================================
  285. Known Bugs and Incompatibilities
  286. ========================================================================
  287.  
  288. Present in any version (29 July 1998)
  289.  
  290. *  There is a bug in Pro 3's MSL with the offsetof macro (it was not
  291.    properly set up for the std namespace and the MSL's ability to toggle
  292.    on and off).
  293.    
  294.    If you receive compile errors in MoreFiles (or anywhere) about size_t
  295.    being an undefined identifier, chances are it is due to this bug
  296.    (MW07208).
  297.    
  298.    The MSL team has fixed this and it should be in the netborne
  299.    patch of MSL v2.4.6. Any version of MSL v2.4.6 or greater should
  300.    function properly in this regard.
  301.  
  302. Present in v1.0 (20 February 1998)
  303.  
  304. *  There has been one report that the QC Tests menu displays garbage. I
  305.    am unable to reproduce this, but if anyone else sees it, please do
  306.    report it to Metrowerks Technical Support.
  307.   
  308.  
  309. ========================================================================
  310. Additional Notes
  311. ========================================================================
  312.  
  313. *  Please read the "Debugging Classes Documentation" for an overview and
  314.    usage instructions.
  315.  
  316. *  Make sure that you create/allocate the LDebugMenuAttachment on the
  317.    heap (via operator new) and also explictly delete it. And you should
  318.    do this in your application object's constructor and destructor.
  319.    This is what the demo application does and you should model after
  320.    it.
  321.    
  322.    Why? The commander and pane tree windows utilize the application
  323.    object as their supercommander. If you do not delete the menu
  324.    before the application object, when the application object is
  325.    deleted, it will walk the commander chain and destroy items....one
  326.    of them being the tree windows. But then, the menu doesn't know
  327.    about this and will go in itself and delete the windows... double
  328.    delete and bad crash!
  329.    
  330.    HOWEVER! This bug should NOT be a problem any longer... due to the
  331.    introduction of LTreeWindow (and integrating it throughout the
  332.    debugging classes). But I still wish to mention this problem as
  333.    someone perhaps utilizing their own menu/window scheme could still
  334.    potentially run into this problem.
  335.    
  336. *  UDebugUtils::GetLowLevelDebuggerInfo() has problems with Norton
  337.    CrashGuard. There is a bug (confirmed with Symantec) with CG
  338.    that basically "trashes" the debugWorld.. or rather, CG does
  339.    something to the debugWorld that we can't very well deal with.
  340.    v2 (and later) of CrashGuard is supposed to fix this, install a
  341.    proper sigature, and give a means for accessing old MacJmp and
  342.    MacJmpFlag. But any version of CG less than 2 (1 or zero) will
  343.    remain a problem.
  344.    
  345.    Have it be known that if you have CrashGuard installed, any
  346.    calls to this method (directly or indirectly) will return unknown
  347.    values.
  348.    
  349.    Workaround? Remove CrashGuard (I suggest this because I personally
  350.    find MacsBug a more useful development tool). Do not just turn it
  351.    off, but totally remove it from your Extensions folder. It seems that
  352.    if it is just off, it still loads and trounces memory... it just
  353.    won't catch your problems. You must remove it entirely (via the
  354.    Extensions Manager or some similar such mechanism).
  355.    
  356.    I am working to find the details and a real solution to the matter.
  357.  
  358. *  Some bugs have been found in various support products (e.g. MacsBug
  359.    6.5.3a3c1's heap scrambling is broken, known Apple bug; QC API has
  360.    some glitches in it; QC save/restore state doesn't seem to work;
  361.    bizarre Spotlight error writing out a large debug output; MW Debug
  362.    can't handle long DebugStr's). All bugs I have discovered I have
  363.    reported to the proper people, and all bugs are, AFAIK, being looked
  364.    into.
  365.    
  366.    ** Note: MacsBug 6.5.4a4 (shipped on CW Pro 3) does fix the heap
  367.    scrambling problem.
  368.    
  369.    If you find a bug with a non-Metrowerks product but with/through the
  370.    use of these classes, please CC Metrowerks Support on your
  371.    correspondance with the other company(s).
  372.  
  373. *  The #define new NEW trick is documented to have problems (it's a
  374.    hack). The purpose of this trick is for DebugNew. In DEBUG_NEW_LEAKS
  375.    mode, a leaks.log is generated. To try to make the log output
  376.    useful, DebugNew uses a custom operator new that takes __FILE__ and
  377.    __LINE__ as arguments (see DebugNew.cp/.h for more information).
  378.    Again, this is only of use under DEBUG_NEW_LEAKS.
  379.    
  380.    In an effort to reduce the pain of modifying code (especially code
  381.    that is not yours) to use "NEW" instead of "new" (to get the gain
  382.    from DebugNew), a "#define new NEW" trick is used. Typically this
  383.    can work, but as I mentioned, it's a hack and has problems.
  384.    
  385.    Since this happens through the magic (evil?) if the preprocessor,
  386.    any instance of "new" will be replaced by "NEW" and subsequently
  387.    DebugNew's tricks. This means the most pain for any declarations
  388.    and definitions of operator new (such as done in LThread, and
  389.    LReentrantMemoryPool/LRMPObject). The compiler will choke.
  390.    
  391.    Some workarounds include:
  392.    
  393.    - Not using DebugNew at all (ensure DebugNew.cp is not in your
  394.      project and PP_DEBUGNEW_SUPPORT is #defined to zero).
  395.    
  396.    - Manually editing the code you wish to leak check to explicitly use
  397.      "NEW" instead of "new".
  398.    
  399.    - Using DebugNew with #define DEBUG_NEW   DEBUG_NEW_BASIC. This way
  400.      you will gain all benefits but leak checking. You can pick that
  401.      back up through something such as Spotlight.
  402.  
  403.  
  404. We welcome your comments, criticisms, feedback, suggestions, bug
  405. reports, etc., and encourge you to please let us know about your
  406. experiences with these classes.  There are a great many combinations and
  407. possibilities of how they can be used, and I very well might have missed
  408. something. :-)
  409.  
  410.  
  411. ========================================================================
  412. Contacting Metrowerks
  413. ========================================================================
  414.  
  415. For bug reports, technical questions, and suggestions, please use the
  416. forms in the Release Notes folder on the CD, and send them to
  417.  
  418. support@metrowerks.com
  419.  
  420. See the CodeWarrior on the Nets document in the Release Notes folder for
  421. more contact information, including a list of Internet newsgroups, 
  422. online services, and patch and update sites.
  423.  
  424. ========================================================================
  425.  
  426. Metrowerks Corporation
  427.  
  428.  
  429.  
  430. ---- For those curious, some interesting notes from Apple Developer
  431. Technical Support on the subject of volume iteration ---
  432.  
  433. Due to bug MW06289 (where UVolume iterated over an audio CD and
  434. caused UVolume::FindAppOnVolume()'s call to ::PBDTGetAPPLSync()
  435. to return a paramErr), I asked Apple Developer Technical Support
  436. (DTS) what other sorts of volumes I need to watch out for when
  437. taking this approach (e.g. ISO 9660 or some other non-HFS
  438. volume).
  439.  
  440. Pete Gontier responded with the below (with credits to Jim
  441. Luther, oh File Manager god). I figured to pass it along as it
  442. might be at least something interesting.
  443.  
  444.  
  445.  
  446. RESPONSE ---------------------------------------------------------
  447.  
  448. John,
  449.  
  450. Nice to hear from you again. Congrats on shipping CW Pro3!
  451.  
  452. To answer your specific question, the unfortunate truth is that
  453. various file systems will produce various error behaviors with
  454. the desktop database routines, as you have found. The last time I
  455. wrote code that needed to handle such things as audio CDs, I just
  456. special-cased some of the errors and commented them in the code
  457. as to why I was treating them specially. That's the only
  458. technique I know of for dealing with this problem. Your code is
  459. not at fault, and there is no way to ask a volume "Do you REALLY
  460. support a desktop database or do you just CLAIM to?" :-(
  461.  
  462. And now here's some general background info:
  463.  
  464. >From time to time, people need to know how to launch an
  465. application given a document or a creator code. It sounds like
  466. you are trying to do something similar. Let me know if I'm way
  467. off in my reading between your lines. There are a number of ways
  468. to achieve this effect. I list them here in decreasing order of
  469. desirability.
  470.  
  471.  --- 1 ---
  472.  
  473. You can ask Finder to do it for you with an AppleScript (or the
  474. equivalent AppleEvents) like this:
  475.  
  476.     tell application "Finder"
  477.         set appToLaunch to (application file id "ttxt") as alias
  478.     end tell
  479.  
  480. ...where "ttxt" is the creator code of the application you care
  481. about. This is the highest level way to do this. Your app can
  482. feed this script to OSACompile and OSAExecute or figure out how
  483. to construct the relevant AppleEvents. There are some useful
  484. MacsBug commands in the AppleScript SDK:
  485.  
  486.   Dev.CD Jul 97 SDK1
  487.     Development Kits (Disc 1)
  488.       AppleScript
  489.         Development Tools
  490.           Tools Goodies
  491.             Macsbug Resources
  492.  
  493.  --- 2 ---
  494.  
  495. You can use a complex algorithm we've provided to some
  496. developers. It takes a long time to implement; I know because I
  497. was the first developer to receive a description of the algorithm
  498. and I implemented it. I'll include a discussion of this algorthm
  499. at the end of this message. This description was valid as of
  500. Finder 7; I'm not sure how it relates to Finder 8. Using the
  501. AppleEvents approach documented above in --- 1 --- isolates you
  502. from this kind of change.
  503.  
  504.  --- 3 ---
  505.  
  506. You can use PBDTGetAPPL. This call searches the desktop database
  507. of a given volume for an application with a given creator code
  508. that was last copied onto the volume. This call is documented on
  509. page 9-15 of Inside Macintosh: More Macintosh Toolbox and on the
  510. web along the following URL:
  511.  
  512.     <http://devworld.apple.com/dev/techsupport/insidemac/
  513.         MoreToolbox/MoreToolbox-497.html>
  514.  
  515. Also, don't miss Q&A TB 19.
  516.  
  517.     <http://devworld.apple.com/dev/qa/tb/tb19.html>
  518.  
  519.  --- 4 ---
  520.  
  521. Finally, you can use PBCatSearch. This call lets you search the
  522. entire catalog of a volume and filter with various criteria
  523. including creator and file type. This call is documented starting
  524. on pages 2-38 and 2-204 of Inside Macintosh: Files and on the web
  525. along the following URL:
  526.  
  527.     <http://devworld.apple.com/dev/techsupport/insidemac/
  528.         Files/Files-252.html>
  529.  
  530. Also, don't miss Technote FL 31:
  531.  
  532.     <http://devworld.apple.com/dev/technotes/fl/fl_31.html>
  533.  
  534.  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  535.  
  536. You may need to mix and match from among the above numbered
  537. techniques. And, as usual, the MoreFiles library should be a
  538. great help with respect to sample code and/or library code you
  539. can simply call. MoreFiles is available on the Tool Chest Edition
  540. of the Developer CD Series:
  541.  
  542.   Dev.CD Aug 97 TC
  543.     Sample Code
  544.       Files
  545.         MoreFiles 1.4.6
  546.  
  547. (Editors Note: as of this writing it is also available at:
  548.  
  549.     <ftp://members.aol.com/JumpLong/>
  550.  
  551. and is also included as part of the debugging classes -JCD)
  552.  
  553.  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  554.  
  555. How Does Finder Determine Which Application to Launch
  556. (assuming multiple volumes are mounted)?
  557.  
  558. Since there could be more than one copy of the application, there
  559. is some logic behind which copy of an application gets used when
  560. you open a file.  Here's what the Finder currently does (we found
  561. this from walking through the Finder source code by hand - we
  562. cannot guarantee this behavior in the future). Start with 1 and
  563. when you find a condition that works, stop.
  564.  
  565. 1) If an application with the correct creator is already running,
  566. it is used. (You can use the Process Manager to look through the
  567. list of running processes to check for this.)
  568.  
  569. 2) If the volume the file is on is a local volume (vMServerAdr
  570. returned by PBHGetVolParms is zero) and an application with the
  571. correct creator is found on that volume (by searching the
  572. volume's desktop file or desktop database), then the copy of the
  573. application which was installed last is launched. (See the
  574. PBDTGetAPPL routine in Inside Macintosh:More Macintosh Toolbox
  575. for more info on the Desktop Manager.  See Tech Note TB 6 -
  576. Resources Contained in the Desktop File for Desktop File
  577. information. The Finder tries the most recent first and if it
  578. cannot be found, tries the other matches returned by calling
  579. PBDTGetAPPL with an index.)
  580.  
  581. 3) If an application with the correct creator is found on the
  582. boot volume, then the copy of the application which was installed
  583. last is launched. (Again, the Finder uses PBDTGetAPPL for this)
  584.  
  585. 4) If an application with the correct creator is found on the
  586. non-local volume the file is on, then the copy of the application
  587. which was installed last is launched.
  588.  
  589. 5) Each volume (except for the boot volume and the volume the
  590. file is on) in the Finder's list of volumes is checked for a copy
  591. of the application.  If an application with the correct creator
  592. is found, then the copy of the application which was installed
  593. last is launched.  (How is the list of volumes ordered? I'll get
  594. to that in a second...)
  595.  
  596. 6) Each open window is searched for an application with the
  597. correct creator.  The windows are searched by volume in the order
  598. that the volumes are in the list.  If one is found, then it's
  599. launched.  This catches those times where an application isn't in
  600. the desktop database.  (To do this, you'd have to use ask the
  601. scriptable Finder for a list of open windows.)
  602.  
  603. Volumes are inserted into the Finder's volume list when they are
  604. mounted.  They are inserted in the list based on a three part
  605. key: 1) is the volume local (vMServerAdr returned by
  606. PBHGetVolParms is zero), 2) does the volume support CatSearch
  607. (bHasCatSearch bit in vMAttrib returned by PBHGetVolParms is set)
  608. 3) volume speed (vMVolumeGrade returned by PBHGetVolParms; lower
  609. values are better; 0 = unrated).  So, if you have two non-local
  610. volumes and only one supports CatSearch, the one with CatSearch
  611. will be used first.  If both support CatSearch, the one that's
  612. fastest will be used.
  613.  
  614. Because the Finder caches information, the Desktop database may
  615. not have the information about the most recently version of
  616. Netscape.  Situations that would not allow the Finder to see the
  617. most recent version of Netscape include:
  618.  
  619. -- if you copy an application onto a volume with a program other
  620. than the Finder, the Finder won't add the new application to the
  621. desktop database until it sees it the first time.
  622.  
  623. -- if you copy an old version of an application to your hard
  624. disk, it may become the version that is launched (since the
  625. Finder will launch the most recently "installed" version it sees,
  626. not necessarily the most recent version).
  627.  
  628. In this situation, you would want to use PBGetCatInfo to compare
  629. creation dates.
  630.  
  631.  --
  632.  
  633.  Pete Gontier, Integer Poet
  634.  Apple Macintosh Developer Technical Support
  635.  
  636. Copyright 1998, Apple Computer, Inc.
  637.  
  638.